#ifndef __fredyn_Panels_h__
#define __fredyn_Panels_h__

#include <vector>

#include <mml/Plane.h>

#include "Panel.h"

namespace xxship
{
  class Panels
  {
    std::vector<Panel> m_panels;

  public:
    /** Constructor. */
    Panels();

    /** Copy-constructor. */
    Panels(Panels const& other);

    /** Destructor. */
    ~Panels();

    /** Copy assignment operator. */
    Panels const& operator=(Panels const& other);

    /** Erase all panels. */
    void clear();

    /** Number of panels. */
    int getNumberOfPanels() const;

    /** Get a panel. */
    Panel const& getPanel(int i) const;

    /** Add a panel. */
    void addPanel(Panel const& panel);

    /** Reduce the panels. */
    Panels createReducedPanels(mml::Planed const& plane) const;

    /** Rotate the panels. */
    void rotate(mml::Matrix3d const& R);

    /** Transform the panels. */
    void translate(mml::Vector3d const& translation);

    /** Maximum x-coordinate of these panels. */
    double getMaxX() const;

    /** Minimum x-coordinate of these panels. */
    double getMinX() const;

    /** Maximum y-coordinate of these panels. */
    double getMaxY() const;

    /** Minimum y-coordinate of these panels. */
    double getMinY() const;

    /** Maximum z-coordinate of these panels. */
    double getMaxZ() const;

    /** Minimum z-coordinate of these panels. */
    double getMinZ() const;

    /** Bounding box in XY-plane */
    void getBoundingBox(double* pMinX, double* pMinY, double* pMaxX, double* pMaxY) const;
  };
}

#endif
